﻿#define _CRT_SECURE_NO_WARNINGS 1
#include "SLTList.h"

void test()
{
	SLTNode* plist = NULL;
	//尾插数据
	STLPushBack(&plist,1);
	STLPushBack(&plist,2);
	STLPushBack(&plist,3);
	STLPushBack(&plist,4);
	SLTPrint(plist);

	//头插数据
	/*STLPushPront(&plist, 99);
	SLTPrint(plist);*/

	//尾删数据
	/*STLPopBack(&plist);
	SLTPrint(plist);*/

	//头删
	/*STLPopPront(&plist);
	SLTPrint(plist);*/

	//查找
	SLTNode* find = SLTFind(plist, 1);
	/*if (find == NULL)
	{
		printf("未找到！\n");
	}
	else
	{
		printf("找到了！\n");
	}*/
	
	//在指定位置之前插⼊数据,需要用查找
	/*SLTInsert(&plist, find, 99);
	SLTPrint(plist);*/

	//在指定位置之后插⼊数据,需要用查找
	/*SLTInsertAfter(find, 99);
	SLTPrint(plist);*/

	//删除pos结点
	/*SLTErase(&plist, find);
	SLTPrint(plist);*/

	//删除pos之后结点
	/*SLTEraseAfter(find);
	SLTPrint(plist);*/

	//销毁链表
	SListDestroy(&plist);
	SLTPrint(plist);
}

int main()
{
	test();
	return 0;
}
